<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
     <button onclick="tcc()">弹出层</button>
     <div class="box">
         <div class="box1">
             <div class="box2">
                 <span onclick="gb()">x</span>
             </div>
             <div class="box3"></div>
         </div>
     </div>
</body>
</html>
<script>
     var tc =document.querySelector('.box')
   function tcc (){
      tc.style.display='block';

   }
   function gb (){
       tc.style.display='none'
   }
</script>
<style>
    .box{
        height: 100vh;
        width: 100%;
        background: rgba(204, 204, 204, 0.397);
        position: absolute;
        top: 0;
        display: none;
    }
    .box1{
        width: 500px;
        height: 200px;
        border: #ff9900 3px solid;
        margin: 0 auto;
        margin-top: 100px;
    }
    .box2{
        background: #ffcc00;
        height: 15%;

    }
    span{
        float: right;
    }
    .box3{
        background: #00ffff;
        height: 85%;
    }
    
</style>